package com.whsxt.sys.data;

import java.util.ArrayList;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonProperty;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString 
public class MenuData {
	
	private Integer id;
	
	@JsonProperty("parentId")
	private Integer pid;
	
	private String title;
	
	private String icon;
	
	private String href;
	
	private Boolean spread;
	
	private List<MenuData> children = new ArrayList<MenuData>();
	
	private String checkArr = "0";
	
	/**
	 *  页面菜单 使用的构造方法
	 * @param id
	 * @param pid
	 * @param title
	 * @param icon
	 * @param href
	 * @param spread
	 */
	public MenuData(Integer id, Integer pid, String title, String icon, String href, Boolean spread) {
		super();
		this.id = id;
		this.pid = pid;
		this.title = title;
		this.icon = icon;
		this.href = href;
		this.spread = spread;
	}
	/**
	 * 	页面树 的构造方法
	 * @param id
	 * @param pid
	 * @param title
	 * @param spread
	 */
	public MenuData(Integer id, Integer pid, String title, Boolean spread) {
		super();
		this.id = id;
		this.pid = pid;
		this.title = title;
		this.spread = spread;
	}

	/**
	 *  增加一个选中的属性
	 * @param id
	 * @param pid
	 * @param title
	 * @param spread
	 * @param checkArr
	 */
	public MenuData(Integer id, Integer pid, String title, Boolean spread, String checkArr) {
		super();
		this.id = id;
		this.pid = pid;
		this.title = title;
		this.spread = spread;
		this.checkArr = checkArr;
	}
}
